import request from '@/utils/request'

export function regApi (data) {
  return request.post('/api/reg', data)
}

export function loginApi (data) {
  return request.post('/api/login', data)
}

export function getUserApi () {
  return request.get('/my/userinfo')
}
/**
 * 修改用户基本信息
 */
export const setUserApi = data => request.put('/my/userinfo', data)

// 获取用户头像
export function uploadImgApi (src) {
  return request.patch('/my/update/avatar', {
    avatar: src
  })
}
// 重置密码
export const updatePwdApi = data => request.patch('/my/updatepwd', data)
